package com.example.provider.service.impl;

import com.example.common.entity.Message;
import com.example.provider.dao.ScheduleDao;
import com.example.provider.service.ScheduleService;
import com.example.provider.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ScheduleServiceImpl implements ScheduleService {
    @Autowired
    private ScheduleDao scheduleDao;

    /**
     * 添加正式开始的项目进度
     * @param demandId 需求id
     * @param workroomId 接收外包工作室id
     * @param companyId 发起外包企业id
     * @return
     */
    @Transactional
    public Message addSchedule(long demandId, int workroomId, int companyId) {
        scheduleDao.insert(new IdWorker(1,1,1).nextId(),
                demandId, workroomId, companyId);
        return new Message(200, "添加成功");
    }
}
